<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE>
<html>
<head>
<jsp:include page="../header.jsp">
	<jsp:param value="添加学员" name="title"/>
</jsp:include>
<script type="text/javascript" src="static/js/studentAdd.js"></script>
</head>
<body>
	<jsp:include page="../menu/menue.jsp"></jsp:include>
	<div class="teacher-content" style="margin-left: 150px; margin-right: 100px; margin-top: 50px;">
	<form  method="post" class="ui form create-form">
		<!-- 如果是新建这里没有值 -->
		<input type="hidden" name="sid" value="${s.id }">
		<div class="ui warning form segment">
		  <div class="ui warning message">
		    <div class="header">${erro }</div>
		  </div>
		  <div class="two fields">
		    <div class="field">
		      <label>姓名*</label>
		      <input placeholder="姓名" type="text" name="userName" 
		      <c:choose>
		      	<c:when test="${stu.name==null }">
		      		value="${param.name }"
		      	</c:when>
		      	<c:otherwise>
		      		value="${stu.name}"
		      	</c:otherwise>
		      </c:choose>>
		    </div>
		    <div class="field">
		      <label>具体来源*</label>
		      <select class="ui fluid dropdown" name="source">
		      		<c:choose>
			    	<c:when test="${stu.source==null }">
			    	<option ${param.education eq '无' ? 'selected' : ''}>无</option>
				    <option ${param.education eq '校招' ? 'selected' : ''}>校招</option>
				    <option ${param.education eq '宣传' ? 'selected' : ''}>宣传</option>
				    <option ${param.education eq '推荐' ? 'selected' : ''}>推荐</option>
				    <option ${param.education eq '其他' ? 'selected' : ''}>其他</option>
				    </c:when>
				    <c:otherwise>
				    <option ${param.education eq '无' ? 'selected' : ''}>无</option>
				    <option ${param.education eq '校招' ? 'selected' : ''}>校招</option>
				    <option ${param.education eq '宣传' ? 'selected' : ''}>宣传</option>
				    <option ${param.education eq '推荐' ? 'selected' : ''}>推荐</option>
				    <option ${param.education eq '其他' ? 'selected' : ''}>其他</option>
				    </c:otherwise>
				 </c:choose> 		
		      </select>
		    </div>
		  </div>
		  <div class="two fields">
		  <div class="field">
			    <label>性别*</label>
			    <select class="ui fluid dropdown" name="gender">
			    <c:choose>
		    		<c:when test="${stu.gender==null }">
		    		<option	${param.gender eq '男' ? 'selected' : '' }>选择性别</option>
		   			<option	${param.gender eq '男' ? 'selected' : '' }>男</option>
		    		<option ${param.gender eq '女' ? 'selected' : '' }>女</option>
		    		</c:when>
		    		<c:otherwise>
		    		<option	${stu.gender eq '男' ? 'selected' : '' }>选择性别</option>
		   			<option	${stu.gender eq '男' ? 'selected' : '' }>男</option>
		    		<option ${stu.gender eq '女' ? 'selected' : '' }>女</option>
		    		</c:otherwise>
		    	</c:choose>
			    </select>
		  </div>
		  <div class="field">
			    <label>学历</label>
			    <select class="ui fluid dropdown" name="education">
			    <c:choose>
			    	<c:when test="${stu.education==null }">
			    	<option ${param.education eq '无' ? 'selected' : ''}>无</option>
				    <option ${param.education eq '初中' ? 'selected' : ''}>初中</option>
				    <option ${param.education eq '高中' ? 'selected' : ''}>高中</option>
				    <option ${param.education eq '专科' ? 'selected' : ''}>专科</option>
				    <option ${param.education eq '本科' ? 'selected' : ''}>本科</option>
				    <option ${param.education eq '社会人员' ? 'selected' : ''}>社会人员</option>
				    </c:when>
				    <c:otherwise>
				    <option ${stu.education eq '无' ? 'selected' : ''}>无</option>
				    <option ${stu.education eq '初中' ? 'selected' : ''}>初中</option>
				    <option ${stu.education eq '高中' ? 'selected' : ''}>高中</option>
				    <option ${stu.education eq '专科' ? 'selected' : ''}>专科</option>
				    <option ${stu.education eq '本科' ? 'selected' : ''}>本科</option>
				    <option ${stu.education eq '社会人员' ? 'selected' : ''}>社会人员</option>
				    </c:otherwise>
				 </c:choose>  
			    </select>
		  </div>
		  </div>
		  <div class="two fields">
		    <div class="field">
		      <label>电话*</label>
		      <input placeholder="电话" type="text" name="phone"
		      <c:choose>
		      	<c:when test="${stu.phone==null }">
		      		value="${param.source }"
		      	</c:when>
		      	<c:otherwise>
		      		value="${stu.phone}"
		      	</c:otherwise>
		      </c:choose>>
		    </div>
		    <div class="field">
		      <label>家庭住址</label>
		      <input placeholder="住址" type="text" name="address"
		      <c:choose>
		      	<c:when test="${stu.address==null }">
		      		value="${param.address }"
		      	</c:when>
		      	<c:otherwise>
		      		value="${stu.address}"
		      	</c:otherwise>
		      </c:choose>>
		    </div>
		  </div>
		  <div class="two fields">
		    <div class="field">
		      <label>身份证号码</label>
		      <input placeholder="身份证" type="text" name="idCard"
		      <c:choose>
		      	<c:when test="${stu.idCard==null }">
		      		value="${param.idCard }"
		      	</c:when>
		      	<c:otherwise>
		      		value="${stu.idCard}"
		      	</c:otherwise>
		      </c:choose>>
		    </div>
		    <div class="field">
		      <label>QQ</label>
		      <input placeholder="学生qq" type="text" name="qq"
		      <c:choose>
		      	<c:when test="${stu.qq==null }">
		      		value="${param.qq }"
		      	</c:when>
		      	<c:otherwise>
		      		value="${stu.qq}"
		      	</c:otherwise>
		      </c:choose>>
		    </div>
		  </div>
		  <div class="two fields">
		    <div class="field">
		      <label>父亲姓名</label>
		      <input placeholder="父亲姓名" type="text" name="fatherName"
		      <c:choose>
		      	<c:when test="${stu.fatherName==null }">
		      		value="${param.fatherName }"
		      	</c:when>
		      	<c:otherwise>
		      		value="${stu.fatherName}"
		      	</c:otherwise>
		      </c:choose>>
		    </div>
		    <div class="field">
		      <label>父亲电话</label>
		      <input placeholder="父亲电话" type="text" name="fatherTel"
		      <c:choose>
		      	<c:when test="${stu.fatherTel==null }">
		      		value="${param.fatherTel }"
		      	</c:when>
		      	<c:otherwise>
		      		value="${stu.fatherTel}"
		      	</c:otherwise>
		      </c:choose>>
		    </div>
		  </div>
		  <div class="two fields">
		    <div class="field">
		      <label>母亲姓名</label>
		      <input placeholder="父亲姓名" type="text" name="motherName"
		      <c:choose>
		      	<c:when test="${stu.motherName==null }">
		      		value="${param.motherName }"
		      	</c:when>
		      	<c:otherwise>
		      		value="${stu.motherName}"
		      	</c:otherwise>
		      </c:choose>>
		    </div>
		    <div class="field">
		      <label>母亲电话</label>
		      <input placeholder="父亲电话" type="text" name="motherTel"
		      <c:choose>
		      	<c:when test="${stu.motherTel==null }">
		      		value="${param.motherTel }"
		      	</c:when>
		      	<c:otherwise>
		      		value="${stu.motherTel}"
		      	</c:otherwise>
		      </c:choose>>
		    </div>
		  </div>
		  <button class="ui button" type="submit">${empty stu ?'创建':'保存' }</button>
		</div>
	</form>
	</div>
</body>
</html>